const mogo = require('./db')

// 创建集合
const cateSchema = mogo.Schema({
    name: String
})

const cateModel = mogo.model('cate', cateSchema)

const wareSchema = mogo.Schema({
    name: String,
    cate:{
        type: mogo.Schema.Types.ObjectId,
        ref: 'cate'
    },
    code: String,
    department: String,
    address: String,
    helpCode: String,
    content: String,
    phone: String,
    person: String,
    isDefault: {
        type: Boolean,
        default: false
    },
    isLock: {
        type: Boolean,
        default: false
    },
    status:{
        type: Boolean,
        default: true
    }
})

const wareModel = mogo.model('ware', wareSchema)

module.exports = {
    cateModel,
    wareModel
}